<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Blogmer Documentation</title>

<style type='text/css' media='all'>@import url('../css/userguide.css');</style>
<link rel='stylesheet' type='text/css' media='all' href='../css/userguide.css' />
<link type="text/css" rel="stylesheet" href="../css/SyntaxHighlighter.css"></link>
<script language="javascript" src="../js/shCore.js"></script>
<script language="javascript" src="../js/shBrushXml.js"></script>
<script language="javascript" src="../js/shBrushPhp.js"></script>
<meta http-equiv='expires' content='-1' />
<meta http-equiv= 'pragma' content='no-cache' />
<meta name='robots' content='all' />
</head>
<body>
<!-- START NAVIGATION -->
<div id="nav"><div id="nav_inner"></div></div>
<div id="nav2"><a name="top">&nbsp;</a></div>
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td><h1>Blogmer beta 2</h1></td>
<td id="breadcrumb_right"><a href="table_of_content.html">Table of contents</a></td>
</tr>
</table>
</div>
<!-- END NAVIGATION -->


<!-- START BREADCRUMB -->
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
<td id="breadcrumb">
  <p><a href="http://speedovation.org/" >Speedovation</a> &nbsp;&#8250;&nbsp;
      <a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
    Table of contents</p>
  </td>

</tr>
</table>
<!-- END BREADCRUMB -->

<br clear="all" />

<!-- START CONTENT -->
<div id="content">
  <h1>Content</h1>
  <p>Each controller generates a different data type. Some gives single array ,2D array and strings.</p>
 
  <p>We've divided it into four major sections. We set a <kbd>where</kbd> condition for each controller's function.This will decide for which type of data we get.</p>
  <p>We'll study each in depth with example.</p>
  <p>This section consist of four sub parts. Its simple once you get the logic. Read all the four section for detailed information.</p>
  <h2>Single Post {where='post'}</h2>
  <p>First one is  single post</p>
  <p>In this section we receive an array </p>
  <ul>
    <li>$post['title_link']</li>
    <li>$post['author_name']</li>
    <li>$post['categories']</li>
    <li>$post['content']</li>
    <li>$post['read_comments']</li>
    <li>$post['comment_form']</li>
  </ul>
  <p>HTML code for above array</p>
  <pre name="code" class="php:collapse">
//single post
&lt;h2&gt;&lt;?=$post['title_link']?&gt;&lt;/h2&gt;
&lt;p class=&quot;post-info&quot;&gt;
Posted by &lt;?=$post['author_name']?&gt; | Filed under &lt;?=$post['categories']?&gt; &lt;/p&gt;
&lt;p&gt;&lt;?=$post['content']?&gt;&lt;/p&gt;
&lt;p&gt;&lt;?=$post['read_comments']?&gt;&lt;/p&gt;
&lt;p&gt;&lt;?=$post['comment_form']?&gt;&lt;/p&gt;
</pre>

  <h2>2D Array  {where='loop'}</h2>
  <p>Second type is 2d array. Each single value of array contains</p>
  <ul>
      <li>$blogmer['date']</li>
        <li>$blogmer['post_title']</li>
        <li>$blogmer['post_status']</li>
        <li>$blogmer['content']</li>
        <li>$blogmer['categories']</li>
        <li>$blogmer['author_name']</li>
        <li>$blogmer['title_link']</li>
        <li>$blogmer['comment_link]</li>
        <li>$blogmer['comment_no']</li>
        <li>$blogmer['total_comments']</li>
        <li> $blogmer['full']</li>
  </ul>
  <p>So to get data we need to execute loop.</p>
  <p>Here is live code example</p>
  <pre name="code" class="php:collapse">
for($i=0;$i&lt;count($allposts)-1;$i++)	
{ 
  $comments=base_url().'blog/post/'.url_title($allposts[$i]['post_title']).'#comments'; ?&gt;
  &lt;h2&gt;&lt;?=$allposts[$i]['title_link'];?&gt;&lt;/h2&gt;
  &lt;p class=&quot;post-info&quot;&gt;Posted by &lt;?=$allposts[$i]['author_name'];?&gt; | Filed under &lt;?=$allposts[$i]['categories'];?&gt; &lt;/p&gt;
  &lt;p&gt;&lt;?=$allposts[$i]['content'];?&gt;&lt;/p&gt;
  &lt;p class=&quot;post-footer&quot;&gt; 
         &lt;a href=&quot;&lt;?=$comments?&gt;&quot; class=&quot;comments&quot;&gt;Comments : &lt;?=$allposts[$i]['comment_no'];?&gt;&lt;/a&gt;
         &lt;span class=&quot;date&quot;&gt;&lt;?=$allposts[$i]['date'];?&gt;&lt;/span&gt;	
  &lt;/p&gt;
  &lt;?php	
 } //end of for loop
  ?>
  </pre>
  <p>&nbsp;</p>
  <h2>Array with 2 value {where='page'}</h2>
  
  <p>An array returns  2 values.</p>
  <ul>
    <li>$page[title_link']</li>
    <li>$page['content']</li>
  </ul>
  <pre name="code" class="php:collapse"> &lt;h2&gt;&lt;?=$page['title_link']?&gt;&lt;/h2&gt;
 &lt;p&gt;&lt;?=$page['content']?&gt;&lt;/p&gt;
</pre>
  <h2>Single variable {where='single'}</h2>
    <p>Returns a $content variable. It contains string based html output;</p>
    <pre name="code" class="php:collapse"> 
&lt;?php break;
case 'single':     ?&gt;
&lt;p&gt;&lt;?=$content?&gt;&lt;/p&gt;</pre>
  
</div>
<!-- END CONTENT -->


<div id="footer">
<p><a href="#top">Top of Page</a></p>
<p><a href="http://speedovation.com">Speedovation</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007-2008 &nbsp;&middot;&nbsp; <a href="http://speedovation.org/">Blogmer</a></p></div>
<script language="javascript">
dp.SyntaxHighlighter.ClipboardSwf = '..js/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
</script>
</body>
</html>